#include "../Include/WebSocketFrameServer.h"

CWebSocketFrameServer::CWebSocketFrameServer(CEventEngine *pListenEngine)
    : CFrameServer(pListenEngine)
{
    m_pFactory = NULL;
}

CWebSocketFrameServer::~CWebSocketFrameServer()
{
}

Bool CWebSocketFrameServer::Start(const CSocketAddr &address, const std::vector<CEventEngine*> &vecAsyncIo, CThreadPool *pWorkPool, IWebSocketHandlerFactory *pFactory)
{
    m_pFactory = pFactory;
    return CFrameServer::Start(address, vecAsyncIo, pWorkPool);
}

CClientEvent* CWebSocketFrameServer::CreateClientEvent(Int32 nClientFD, const CSocketAddr &addr, CEventEngine *pEngine, IMessageDispatcher *pDispatcher)
{
    CWebSocketClientEvent *pEvent = new CWebSocketClientEvent(nClientFD, addr, pEngine, pDispatcher, m_pFactory);
    return pEvent;
}
